#!/usr/bin/env python
#
#       accessories.py
#
#       Copyright 2009 karthikeyan S. <kaarthikeyapreyan@gmail.com>
#
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

import wx

def selcolour(entity):
    """
    select the colour
    based on the entity type
    """
    if entity =="class":
        colour="#ADD8E6"
    elif entity =="function":
        colour="#FAEBD7"
    else :
        colour="#E6F1F5"
    return colour

def requestHelp(mod):
    """
    Help over the requested object
    Retrived from the Doc strings
    """
    return inspect.getdoc(mod)

def infobox(baseframe,text,state,icon,size=wx.DEFAULT):
    """
    Information Box
    """
    dlg = wx.MessageDialog(baseframe,text,state, icon)
    dlg.ShowModal()
    dlg.Destroy()

def textentry(baseframe, text):
    dlg = wx.TextEntryDialog(baseframe, text,'PyTestGenerator')
    if dlg.ShowModal() == wx.ID_OK:
        return dlg.GetValue()
    dlg.Destroy()

